import 'package:json_annotation/json_annotation.dart';

part 'tappay_cart_item.g.dart';

@JsonSerializable()
class TappayCartItem {
  /// 名稱
  @JsonKey(name: 'name')
  final String name;

  /// 价格
  @JsonKey(name: 'price')
  final double price;

  /// 是否為待處理品項
  @JsonKey(name: 'isPending')
  final bool? isPending;

  TappayCartItem({
    required this.name,
    required this.price,
    this.isPending,
  });

  factory TappayCartItem.fromJson(Map<String, dynamic> json) => _$TappayCartItemFromJson(json);

  Map<String, dynamic> toJson() => _$TappayCartItemToJson(this);
}